package com.yyi.springcloud.controller;


import com.yyi.springcloud.common.JedisClientSingle;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/mysqlapi/RedisAPI")
public class Mysql_RedisController {

    @Resource
    private JedisClientSingle jedisClientSingle;
    //http://localhost:8080/bxxs/api/RedisAPI/testRedis
    @ResponseBody
    @RequestMapping(value = "/testRedis", method = RequestMethod.GET)
    public String getNewOneTestData(String primaryKey, String sensorNo){
        jedisClientSingle.selectDbHSet(1,"loves","sxl","zy");
        String s = jedisClientSingle.selectDbHGet(1, "loves", "sxl");
        if(s.equals("zy")){
            return "success";
        }else{
            return "fail";
        }
    }
}
